﻿using SharpDX.Mathematics.Interop;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;

namespace DirectXTest.Src
{
    public static class RandomColorUtils
    {
        public static RawColor4 RandomColor()
        {
            const float n = 255f;
            Color color = ColorSelect();
            return new RawColor4(color.R / n, color.G / n, color.B / n, color.A / n);
        }

        public static Color ColorSelect()
        {
            int iSeed = 10;
            Random ro = new Random(iSeed);
            long tick = DateTime.Now.Ticks;
            Random ran = new Random((int)(tick & 0xffffffffL) | (int)(tick >> 32));
            int R = ran.Next(255);
            int G = ran.Next(255);
            int B = ran.Next(255);
            B = (R + G > 400) ? R + G - 400 : B;//0 : 380 - R - G;
            B = (B > 255) ? 255 : B;
            return Color.FromArgb(R, G, B);
        }
    }
}
